#include <iostream>
#include <stdio.h>
#include <queue>
#include <string.h>
using std::cout;
using std::cin;
using std::endl;
typedef long long LL;
const int MAXN=1007;
char M[MAXN][MAXN];
int Dis[MAXN][MAXN];
bool _in[MAXN][MAXN];
int dir_x[]={0,1,0,-1};
int dir_y[]={1,0,-1,0};
struct node {
    int x, y;
};
int x, y, n, m, k, d;
std::queue<node> q;
node pre, nex;
int cnt=0;
void BFS() {
    while(!q.empty()) {
        pre=q.front(); q.pop();
        _in[pre.x][pre.y] = false;
        for (int i=0; i<4; ++i) {
            x = pre.x + dir_x[i]; y = pre.y + dir_y[i];
            if (!(x>0 && x<=n && y>0 && y<=n)) continue;
            if (M[x][y] == -1) continue;
            if (Dis[pre.x][pre.y] + 1 < Dis[x][y]) {
                nex.x=x; nex.y=y;
                Dis[x][y] = Dis[pre.x][pre.y] + 1;
                if (!_in[x][y]) q.push(nex);
            }
            //if (M[x][y] == 1)
        }
    }
}
struct quest{
    int x, y, num;
};
int main() {
    #ifdef hai
    freopen("in.txt", "r", stdin);
    #endif
    memset(_in, 0, sizeof(_in));
    memset(Dis, 0x3f, sizeof(Dis));
    cin>>n>>m>>k>>d;
    for (int i=0; i<m; ++i) {
        scanf("%d %d", &x, &y);
        M[x][y] = 1;
        Dis[x][y]=0;
        pre.x=x; pre.y=y;
        _in[x][y]=true;
        q.push(pre);
    }
    quest tmp;
    std::queue<quest> ask;
    for (int i=0; i<k; ++i) {
        scanf("%d %d %d", &tmp.x, &tmp.y, &tmp.num);
        ask.push(tmp);
    }
    for (int i=0, t_x, t_y; i<d; ++i) {
        scanf("%d %d", &t_x, &t_y);
        M[t_x][t_y] = -1;
    }
    BFS();
    LL res=0;
    while (!ask.empty()) {
        tmp = ask.front(); ask.pop();
        res += Dis[tmp.x][tmp.y] * tmp.num;
    }
    printf("%lld\n", res);
    return 0;
}
